<template>
  <div class="home-container">
    <div class="home-content">
      <h1>欢迎来到基于区块链的堡垒机日志分析系统</h1>
      <button @click="goToDashboard">立即开始</button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Home',
  methods: {
    goToDashboard() {
      // 跳转到仪表板页面
      this.$router.push('/dashboard');
    }
  }
};
</script>

<style scoped>
/* 页面容器 */
.home-container {
  background: url('../assets/background.jpg') no-repeat center center fixed; /* 保留背景图 */
  background-size: cover;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  font-family: 'Arial', sans-serif;
  position: relative;
}

/* 背景覆盖的渐变层 */
.home-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* 半透明黑色遮罩 */
  z-index: 1;
}

/* 内容容器 */
.home-content {
  position: relative;
  background-color: rgba(0, 0, 0, 0.6); /* 半透明黑色背景 */
  padding: 50px;
  border-radius: 15px;
  max-width: 700px;
  width: 80%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: fadeIn 1s ease-out;
  z-index: 2; /* 确保内容在背景遮罩上方 */
  transition: transform 0.3s ease-in-out;
}

/* 标题 */
h1 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 1px;
  line-height: 1.3;
  animation: fadeIn 1s ease-out;
}

/* 描述文本 */
p {
  font-size: 20px;
  margin-bottom: 30px;
  line-height: 1.6;
  animation: fadeIn 1.5s ease-out;
}

/* 按钮 */
button {
  padding: 15px 30px;
  font-size: 18px;
  background-color: #f07f3b;
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: fadeIn 2s ease-out;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

button:hover {
  background-color: #c46627;
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

/* 动画效果 */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 按钮的焦点效果 */
button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}
</style>
